import { Injectable } from '@nestjs/common';
import { InjectModel } from '@nestjs/mongoose';
import { Model } from 'mongoose';
import { WxLoggerDTO, WxLoggerModel } from '../model/dto/logger.dto';

@Injectable()
export class WxLoggerService {
    constructor(@InjectModel('WxLogger') private readonly logModel: Model<WxLoggerDTO>) {}


    //保存model            
    async createDocument(value:WxLoggerModel) {

       return await this.logModel.create(value)
    }

    async findAll() {
        return await this.logModel.find().limit(10).exec();
    }
}
